/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.wen.qqrobot;

import java.util.HashSet;
import java.util.Set;

/**
 * Created by wenwen on 2016/10/5.
 * version 1.0
 */
public class GroupFilter {

    private final Set<String> groups = new HashSet<String>();

    public GroupFilter() {
    }

    public GroupFilter(String string) {
        String[] s = string.split(";");
        for (String group : s) {
            System.out.println("GroupFilter-" + group);
            this.groups.add(group);
        }
    }

    public boolean contains(String o) {
        return groups.contains(o);
    }

    public boolean add(String e) {
        return groups.add(e);
    }

    public int size() {
        return groups.size();
    }

    public boolean isEmpty() {
        return groups.isEmpty();
    }

    public boolean remove(String o) {
        return groups.remove(o);
    }

    public void clear() {
        groups.clear();
    }

}
